package com.xyauto.FloatBarReceiver;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Build;
import android.os.IBinder;
import android.util.Log;

import com.xyauto.service.AuxiliaryService;


public class FloatBarReceiver extends BroadcastReceiver
{

	@Override
	public void onReceive(Context context, Intent intent)
	{
		if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED"))
		{
			Log.e("TAG","开机启动");
			Intent intent2 = new Intent().setClass(context, AuxiliaryService.class);

			/*if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
				context.startForegroundService(intent2);
				Log.e("TAG","开机启动startForegroundService");
			} else {
				context.startService(intent2);
				Log.e("TAG","开机启动startService");
			}*/
			context.startService(intent2);
		//	context.startService(new Intent(context, AuxiliaryService.class));
		}	
	}



}
